import $axios, { Result } from '@/plugins/axios'
import { PageParam } from '@/type'
import { AxiosResponse } from 'axios'
interface IData {
  year: string | number
}
/**
 * 获取视图的所有事项相关数据按照年份
 * @param year
 */
export async function getAllViewMatterStatus(
  data: IData,
): Promise<AxiosResponse<Result>> {
  return await $axios.post(
    '/supervision-api/viewMatterStatus/getAllViewMatterStatus',
    data,
  )
}

/**
 * 十五类重要工作完成情况统计
 * @param year
 */
export async function getAllDomainViewMatterStatus(
  data: IData,
): Promise<AxiosResponse<Result>> {
  return await $axios.post(
    '/supervision-api/viewMatterStatus/getAllDomainViewMatterStatus',
    data,
  )
}

/**
 * 驾驶舱重点关注
 * @param year
 */
export async function getAllMatterFocus(
  data: IData,
): Promise<AxiosResponse<Result>> {
  return await $axios.post(
    '/supervision-api/viewMatterStatus/getAllMatterFocus',
    data,
  )
}

/**
 * 事项办理统计列表
 * @param param 分页查询参数
 */
export async function queryMatterProcessStatisticsDetails(
  param: PageParam,
): Promise<AxiosResponse<Result>> {
  return await $axios.post(
    '/supervision-api/matter/queryMatterProcessStatisticsDetails',
    {
      ...param,
    },
  )
}

/**
 * 获取部门考核排名数据
 * @param IData
 */
export async function queryDepartmentalAssessment(
  data: IData,
): Promise<AxiosResponse<Result>> {
  return await $axios.post(
    '/supervision-api/home/queryDepartmentalAssessment',
    data,
  )
}

/**
 * 获取部门考核排名明细数据
 * @param IData
 */
export async function queryDepartmentalAssessmentDetails(
  param: PageParam,
): Promise<AxiosResponse<Result>> {
  return await $axios.post(
    '/supervision-api/home/queryDepartmentalAssessmentDetails',
    {
      ...param,
    },
  )
}

/**
 * 获取驾驶舱相关链接
 */
export async function getCommonlyLinks(): Promise<AxiosResponse<Result>> {
  return await $axios.get('/supervision-api/commonlyLinks/getCommonlyLinks')
}
